#include "process.h"

char buffer[NUM] = {0};
//用于存储进度条
const char* show = "|/-\\";
void process(double rate)
{
    static int count = 0;
    int ret = (int)rate;
    if(ret == count+1 )
    {
        if(count>=1)
        buffer[count-1] = flag1;
        buffer[count] = flag2;
        ++count;
        
    }
    int _count = ret%4;
    printf("[\033[0m\033[1;31m%-100s\033[0m][%-3.2lf%%][%c]\r", buffer,rate,show[_count] );//字符串输出
    fflush(stdout);
}
